import request from "@/utils/request";

// 查询材料商列表
export function listMaterialSupplier(query) {
  return request({
    url: "/decor/materialSupplier/list",
    method: "get",
    params: query,
  });
}

// 查询材料商详细
export function getMaterialSupplier(materialSupplierId) {
  return request({
    url: "/decor/materialSupplier/" + materialSupplierId,
    method: "get",
  });
}

// 新增材料商
export function addMaterialSupplier(data) {
  return request({
    url: "/decor/materialSupplier",
    method: "post",
    data: data,
  });
}

// 修改材料商
export function updateMaterialSupplier(data) {
  return request({
    url: "/decor/materialSupplier",
    method: "put",
    data: data,
  });
}

// 删除材料商
export function delMaterialSupplier(materialSupplierId) {
  return request({
    url: "/decor/materialSupplier/" + materialSupplierId,
    method: "delete",
  });
}
// 材料商认证新增
export function addMaterialAuthentication(data) {
  return request({
    url: "/decor/platform/materialSupplier/app",
    method: "post",
    data: data,
  });
}
// 材料商认证获取信息
export function getMaterialAuthentication() {
  return request({
    url: "/decor/platform/materialSupplier",
    method: "get",
  });
}
// 材料商认证修改
export function updateMaterialAuthentication(data) {
  return request({
    url: "/decor/platform/materialSupplier",
    method: "put",
    data: data,
  });
}
// 材料商平台管理
// 查询列表
export function getPlatformMaterialList(data) {
  return request({
    url: "/decor/platform/materialSupplier/material/list",
    method: "get",
    params: data,
  });
}
// 获取材料总数
export function getPlatformMaterialListTotal(materialSupplierId) {
  return request({
    url: "decor/platform/materialSupplier/material/total/" + materialSupplierId,
    method: "get",
  });
}
// 删除
export function delPlatformMaterial(materialId) {
  return request({
    url: "/decor/platform/materialSupplier/material/" + materialId,
    method: "delete",
  });
}
// 详情
export function getPlatformMaterialDetail(materialId) {
  return request({
    url: "/decor/platform/materialSupplier/material/" + materialId,
    method: "get",
  });
}
// 修改
export function editPlatformMaterial(data) {
  return request({
    url: "/decor/platform/materialSupplier/material/status",
    method: "put",
    data: data,
  });
}
// 材料修改
export function editPlatformMaterialInfo(data) {
  return request({
    url: "/decor/platform/materialSupplier/material",
    method: "put",
    data: data,
  });
}
